import React from 'react';
import { Menu } from 'antd';
import {NavLink} from "react-router-dom";
import './DepartmentAndStaff.css';

class DepartmentAndStaff extends React.Component {
    constructor(props){
        super(props);
        this.state={
            current:'userAccount', //导航的当前页
        }
    }
    //点击导航，改变state
    handleClick = e => {
        this.setState({
            current: e.key,
        });
    };
    render() {
        return (
            <div className='DepartmentAndStaffPage'>
                <Menu onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal">
                    <Menu.Item key="userAccount">
                        <NavLink to='/homepage/departmentandstaff/usercount'>员工账号</NavLink>
                    </Menu.Item>
                    <Menu.Item key="depSet">
                        <NavLink to='/homepage/departmentandstaff/staffset'>部门设置</NavLink>
                    </Menu.Item>
                    {/*<Menu.Item key="role">
                        <NavLink to='/homepage/departmentandstaff/staffrole'>角色权限设置</NavLink>
                    </Menu.Item>*/}
                </Menu>
                <div>
                    {this.props.children}
                </div>
            </div>
        );
    }
}

export default DepartmentAndStaff;